		new WOW().init();

		$().UItoTop({ easingType: 'easeOutQuart' });

		$(".banner-image").backstretch(['images/cross/16.jpg',]);

				// Fixed header
		//-----------------------------------------------
		$(window).scroll(function() {
			if (($(".header.fixed").length > 0)) { 
				if(($(this).scrollTop() > 0) && ($(window).width() > 767)) {
					$("body").addClass("fixed-header-on");
				} else {
					$("body").removeClass("fixed-header-on");
				}
			};
		});

		$(window).load(function() {
			if (($(".header.fixed").length > 0)) { 
				if(($(this).scrollTop() > 0) && ($(window).width() > 767)) {
					$("body").addClass("fixed-header-on");
				} else {
					$("body").removeClass("fixed-header-on");
				}
			};
		});

		// Isotope filters
		//-----------------------------------------------
		if ($('.isotope-container').length>0) {
			$(window).load(function() {
				$('.isotope-container').fadeIn();
				var $container = $('.isotope-container').isotope({
					itemSelector: '.isotope-item',
					layoutMode: 'masonry',
					transitionDuration: '0.6s',
					filter: "*"
				});
				// filter items on button click
				$('.filters').on( 'click', 'ul.nav li a', function() {
					var filterValue = $(this).attr('data-filter');
					$(".filters").find("li.active").removeClass("active");
					$(this).parent().addClass("active");
					$container.isotope({ filter: filterValue });
					return false;
				});
			});
		};
			//Modal
		//-----------------------------------------------
		if($(".modal").length>0) {
			$(".modal").each(function() {
				$(".modal").prependTo( "body" );
			});
		}
		//获取url参数
		function getQueryString(name) { 
	        var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i"); 
	        var r = window.location.search.substr(1).match(reg); 
	        if (r != null) return unescape(r[2]); 
	        return null; 
   		 }


   		var hospitalMsg = [];
   		var doctorMsg=[];
		var num = 1;
		function getHos(){
				$.ajax({
						type:"get",
						url:"json/ty.json",
						async:false,			// 是否异步,默认是异步,慎用
						dataType:"json",
						success:function(res){
							
							hospitalMsg = res[0].doctor;
							doctorMsg=[];
							$("#doc").html('');

								 for(let i = 0;i<hospitalMsg.length;i++){
									 if(hospitalMsg[i]){
										doctorMsg.push(hospitalMsg[i]);
							 		}
								}
						

							console.log(doctorMsg)

						
							for(let i=0;i<doctorMsg.length;i++){
								let docSchool = doctorMsg[i].doc_school;

								$("#doc").append(
								`
									<div class="col-md-6 col-sm-12 clearfix WS" >
										<div class="fl hospitalLogo" style="border:none;">
											<img src="${doctorMsg[i].doc_img}" alt="">
										</div>
										<div class="fr hosName">
											<p>
												<span class="hosTitle" style="font-size:0.4rem;">${doctorMsg[i].doc_name}</span>
											</p>
											<p class="pro"> ${doctorMsg[i].doc_pro}</p>
											<div class="schoolmsg">
												${docSchool}
											</div>
												<button type="button" class="btn btn-primary btn-lg" data-toggle="modal" data-target="#myModal${doctorMsg[i].doc_id}" style="background-color:#4c92a6">
											  点击查看具体介绍
											</button>
										</div>
										
										<div class="modal fade" id="myModal${doctorMsg[i].doc_id}" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
										  <div class="modal-dialog modal-lg" role="document">
										    <div class="modal-content">
										      <div class="modal-header">
										        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
										        <h4 class="modal-title" id="myModalLabel">${doctorMsg[i].doc_name}</h4>
										      </div>
										      <div class="modal-body">
										        <div class="row">
										        	<div class="col-md-6 col-xs-12">
														<img src="${doctorMsg[i].doc_img}" style="margin:0 auto;" alt="">
													</div>
													<div class="col-md-6 col-xs-12">
														<div class="hosName" style="width:100%;">
															<p>
																<span class="hosTitle" style="font-size:.32rem;">${doctorMsg[i].doc_name}</span>
															</p>
															<p class="pro"> ${doctorMsg[i].doc_pro}</p>
															
														</div>
														<div class="bg" style="width:100%;">
															
															${doctorMsg[i].doc_bg}
														</div>
													</div>
										        </div>
										       
										      </div>
										      <div class="modal-footer">
										        <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
										      </div>
										    </div>
										  </div>
										</div>
									</div>
								`
								)
							}
							
						}
				});
		};
		getHos();

		function browserRedirect(){  
          var sUserAgent = navigator.userAgent.toLowerCase();  
          var bIsIpad = sUserAgent.match(/ipad/i) == "ipad";  
          var bIsIphoneOs = sUserAgent.match(/iphone os/i) == "iphone os";  
          var bIsMidp = sUserAgent.match(/midp/i) == "midp";  
          var bIsUc7 = sUserAgent.match(/rv:1.2.3.4/i) == "rv:1.2.3.4";  
          var bIsUc = sUserAgent.match(/ucweb/i) == "ucweb";  
          var bIsAndroid = sUserAgent.match(/android/i) == "android";  
          var bIsCE = sUserAgent.match(/windows ce/i) == "windows ce";  
          var bIsWM = sUserAgent.match(/windows mobile/i) == "windows mobile";  
	          if (bIsIpad || bIsIphoneOs || bIsMidp || bIsUc7 || bIsUc || bIsAndroid || bIsCE || bIsWM) {  
	                
	                $(".mobilefooter").show();
	                $(".pcfooter").hide();
	          } else {  
	               
	          }  
        	}  
        	browserRedirect();